<template>
  <view class="page_root" data-page-name="1231" data-page-identification="a_rguwr23liw">
      
  </view>
</template>
<script setup>

  import {
    ref,reactive,toRaw,markRaw,
    watch,computed,
    onBeforeMount,onMounted,onBeforeUnmount,onUnmounted,onActivated,onDeactivated,getCurrentInstance
  } from "vue";
  import { useRoute } from 'vue-router';
  const route = useRoute();
  import { get, post, put, del, request, requestWithHeaders } from '@/utils/http/Axios';
  import { isEqual, cloneDeep, isNullOrEmpty, isEmptyArr, isArray, isNullOrUnDef, localGet, traversalTreeStructure, set, checkCaseCondition, throttle, merge, switchCase, dateParse, debounce } from '@/utils/index';
  import { CovertOptions, getChartsDataSourceConvert } from '@/utils/chart';
  import { propertyFormatByNumber, propertyFormatByPercentage, propertyFormatByDate } from '@/utils/format';
  import { FormFormat } from '@/utils/formFormat'
  import dayjs from 'dayjs';
  // import '@vueup/vue-quill/dist/vue-quill.snow.css';
  
  import { handleRedirect, permission } from '@/utils/common'
  import { onPullDownRefresh, onLoad, onReady, onShow, onHide, onPageScroll } from '@dcloudio/uni-app'
  


  // ---------------------------- 属性定义 ----------------------------
  const sourceId = "page50001907"

    // 是否显示菜单按钮
    const isMenuIconShow = false;
    // NAVIGATION_MENU
    const handleShowNavigation = ()=>{};


  const setTimeOutList = [];





  // ============================ 属性定义 ============================

  // ---------------------------- 元素数据引用 ----------------------------
  // 动态key的map
  const fieldTypeMap = {};
  // 动态key的map
  const refMap = {};

  const showState = reactive({

  })
  // ============================ 元素数据引用 ============================

  // ---------------------------- 数据 ----------------------------


  // ============================ 数据 ============================

  // ---------------------------- 方法 ----------------------------
  // ---------------------------- 页面数据 ----------------------------


  // ============================ 页面数据 ============================

  // ---------------------------- 响应 ----------------------------

  // ============================ 响应 ============================

  // ---------------------------- 函数 ----------------------------

  // 自定义函数 返回上一页
  const customFunction_goBack_iw7h9p8j0q =  (...params) => {
    uni.navigateBack()
  }

  // ============================ 函数 ============================

  // ---------------------------- 页面参数 ----------------------------

  const pageParameter_state = reactive({
      'processInstanceId': undefined,
  })

  // ============================ 页面参数 ============================

  // ---------------------------- 组件事件处理方法 ----------------------------


  // ============================ 组件事件处理方法 ============================

  // ============================ 方法 ============================

  // ---------------------------- 生命周期 ----------------------------

  const pageScrollTop = ref(0)

  

  
  const routeOption = ref({})
  onLoad((option) => {
    routeOption.value = option;
  });
  onReady(() => {
    setPageParams(routeOption.value)
    // 设置表单的rule
    try{

    }catch{
        // do nothing
    }
  });
  // 图表刷新标记
  const uChartsReshowFlag = ref(false);
  onHide(() => { // 页面隐藏后标记置为false(如果不置为false无法触发图表更新)
      uChartsReshowFlag.value = false
  })
  onShow(() => {
      uChartsReshowFlag.value = true; // 页面激活后,标记置为true

      setPageParams(routeOption.value)
  })
  onPageScroll(e => {
      pageScrollTop.value = e.scrollTop
  });
  

  const setPageParams = (routerParam)=>{
    const pageParams = [{"dataType":"STRING","dependencies":[],"name":"processInstanceId"}];
    const strategyMap = {
      STRING: (param, paramValue) => {
        pageParameter_state[param.name] = paramValue;
      },
      BOOLEAN: (param, paramValue) => {
        if('true' === (paramValue || '').toLowerCase()) {
          pageParameter_state[param.name] = true
        } else if('false' === (paramValue || '').toLowerCase()) {
          pageParameter_state[param.name] = false
        } else {
          // TODO: 是否要支持toast
          console.error('参数传入错误！类型不匹配！');
        }
      },
      NUMBER: (param, paramValue) => {
        if (!isNaN(paramValue)) {
          pageParameter_state[param.name] = Number(paramValue);
        } else {
          // TODO: 是否要支持toast
          console.error('参数传入错误！类型不匹配！');
        }
      },
      ARRAY: (param, paramValue) => {
        if (isNullOrUnDef(paramValue) || !paramValue || paramValue=== 'undefined') { // default value
          pageParameter_state[param.name] = [];
        } else if(paramValue.trim().startsWith('[') && paramValue.trim().endsWith(']')) {
          try {
            pageParameter_state[param.name] = JSON.parse(decodeURI(paramValue));
          } catch (error) {
            console.error('参数解析失败 ',error);
          }
        } else {
          console.error('参数传入错误！类型不匹配！');
        }
      },
    };
    pageParams.forEach((param) => {
      strategyMap[param.dataType](param, routerParam[param.name])
    });


  }

  onUnmounted(() => {
    // 销毁定时器
    setTimeOutList.forEach(({ repeat, timer }) => {
      repeat ?  clearInterval(timer): clearTimeout(timer);
    });
  });


  
  onPullDownRefresh(() => {
    // 下拉刷新
    setTimeout(() => {
        uni.stopPullDownRefresh()
    }, 1000)
  })
  

  // ============================ 生命周期 ============================

  // ---------------------------- 数据关联处理 ----------------------------
  // ---------------------------- 组件数据同步 ----------------------------

  // ============================ 组件数据同步 ============================
  //
  // ============================ 数据关联处理 ============================

  // ---------------------- 不同组件自定义的处理逻辑 ---------------------

  // ====================== 不同组件自定义的处理逻辑 ======================


  // ================================定制化逻辑========================================
  window.location = 'https://ppm-stage.allintechinc.com/app_50000005/page/50001252'
</script>
<style lang="less" scoped>
  .page_root {
      min-height: 100%;
      box-sizing: border-box;
  }


  .page_root {
    min-height: 100%;
    box-sizing: border-box;
    padding: 0 16px;
    /* 留出按钮的高度 */
  }

  .main{
    background-color: #3575C7;
  }
  .record-date {
    display: flex;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 1);
    border-radius: 4px;
    margin: 0 0 16px 0;
    font-size: 14px;
    color: #fff;
    padding: 0 12px 0 12px;
    line-height: 40px;
  }

  .date-left {
    font-size: 14px;
  }

  .date-right {
    flex: 1;
    text-align: right;
  }

  .record-body {
    background-color: #fff;
    border-radius: 8px;
  }

  .record-title {
    height: 32px;
    background-image: linear-gradient(270deg, rgba(26, 179, 255, 0.00) 0%, #1AB3FF 100%);
    border-radius: 4px 4px 0px 0px;
    font-size: 14px;
    padding: 0 12px 0 12px;
    color: #fff;
    display: block;
    line-height: 32px;
    display: flex;
  }

  .title-left {}

  .title-right {
    flex: 1;
    text-align: right;
  }

  .record-content {
    display: flex;
    flex-direction: column;
    padding: 11px 12px 11px 12px;
    font-size: 14px;
  }

  .content-box {
    margin-bottom: 10px;
  }

  .project-name {
    color: #00125E;
    letter-spacing: 0;
    line-height: 18px;
    font-weight: 600;
  }

  .phase,
  .task-name,
  .task-time,
  .description,
  .risk,
  .solution,
  .risk-description {
    color: #848EB3;
    letter-spacing: 0;
    font-weight: 400;
  }

  .phase-content,
  .task-name-content,
  .task-time-content,
  .description-content,
  .risk-content,
  .solution-content,
  .risk-description-content {
    color: #00125E;
    letter-spacing: 0;
    font-weight: 400;
  }

  .fixed-button {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #1AB3FF;
    color: #fff;
    padding: 15rpx;
    text-align: center;
    border: none;
  }
</style>